package com.etc.medical.feign;

import com.etc.common.utils.Result;
import com.etc.cure.entity.Hospital;
import com.etc.medical.client.HospitalClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/inHospital")
@CrossOrigin(origins = "*")
public class HospitalFeign {
    @Resource
    private HospitalClient hospitalClient;

    /**
     * 查询医生Id下的所有的住院病人信息
     */
    @RequestMapping("/queryByDocId")
    public Result queryByDocId(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                               @RequestParam("docId") String docId) {
        return hospitalClient.queryByDocId(pageNum, pageSize, docId);
    }
    /**
     * 根据门诊Id查询住院病人信息
     */
    @RequestMapping("/queryByOsId")
    public Result queryByOsId(@RequestParam("osId") String osId) {
        return hospitalClient.queryByOsId(osId);
    }
    /**
     * 新增住院病人信息
     */
    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    public Result insert(@RequestParam("osId") String osId , @RequestParam("docId") String docId) {
        return hospitalClient.insert(osId,docId);
    }
    /**
     * 修改住院病人信息
     */
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public Result update( Hospital hospital ,@RequestParam("docId") String docId) {
        return hospitalClient.update(hospital,docId);
    }
}
